package win.start.core;

import org.apache.http.*;
import org.apache.http.message.BasicHeader;
import org.apache.http.message.BasicHttpRequest;
import org.apache.http.message.BasicHttpResponse;
import org.junit.Test;

/**
 * 用于练习基本概念
 * Created by 张少昆 on 2017/6/21.
 */
public class Demo1 {
	@Test
	public void basic(){
		// 这是请求
		HttpRequest httpRequest = new BasicHttpRequest("get", "http://www.baidu.com", HttpVersion.HTTP_1_1);
		// 这是响应
		HttpResponse httpResponse = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK, "OK");
		// 这是Header
		Header contentType = new BasicHeader(HttpHeaders.CONTENT_TYPE, "text/html");
		// 这里是common properties
		httpRequest.addHeader(contentType);
		httpResponse.addHeader(contentType);
	}
}
